#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include "stklevelitem.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class QLabel;
class QVBoxLayout;
class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

private:
    void initUI(void);
    void initStkInfo(void);
    void initGearInfo(void);
    QWidget* gearInfo(int num, const QVector<std::shared_ptr<bid_ask_item_t>> &items, bool type );
    bool initData();
    void loadStyle(const QString &fileName);
private:
    Ui::Widget *ui;
    QLabel *mLblStkName;    // 股票名称
    QLabel *mLblStkCode;    // 股票代码
    QLabel *mLblStkPrice;
    QLabel *mLblStkFluctuation;         // 当前波动
    QLabel *mLblstkFluctuationRate;     // 波动率

    QLabel *mLblHightName;  // 最高价
    QLabel *mLblHighVal;
    QLabel *mLblOpenName;   // 开盘价
    QLabel *mLblOpenVal;
    QLabel *mLblVolumeName; // 成交量
    QLabel *mLblVolumeVal;
    QLabel *mLblLowName;    //最低价
    QLabel *mLblLowVal;
    QLabel *mLblPreCloseName; // 昨收价
    QLabel *mLblPreCloseVal;
    QLabel *mLblTurnoverName; // 成交额
    QLabel *mLblTurnoverVal;
    QLabel *mLblAvgPriceName;   //平均价
    QLabel *mLblAvgPriceVal;
    QLabel *mLblPETTMName;      //市盈率TTM
    QLabel *mLblPETTMVal;
    QLabel  *mLblMarketCapName; //总市值
    QLabel   *mLblMarketCapVal;
    QLabel   *mLblAmplitudName; //振幅
    QLabel   *mLblAmplitudVal;
    QLabel  *mLblPEStaticName;  //市盈率静
    QLabel  *mLblPeStaticVal;
    QLabel  *mLblSharesOutstandingName; //总股本
    QLabel  *mLblSharesOutstandingVal;
    QLabel  *mLblTurnoverRatioName;     // 换手率
    QLabel  *mLblTurnoverRatioVal;
    QLabel  *mLblPBName;        //市净率
    QLabel  *mLblPBVal;
    QLabel  *mLblFloatCapName;  //流通值
    QLabel  *mLblFloatCapVal;
    QLabel  *mLbl52WkHighName;  //52周最高
    QLabel  *mLbl52WkHighVal;
    QLabel  *mLblBidAskName;    //委比
    QLabel  *mLblBidAskVal;
    QLabel  *mLblShsFloatName;  //流通股
    QLabel  *mLblShsFloatVal;
    QLabel  *mLbl52WkLowName;   //52周最低
    QLabel  *mLbl52WkLowVal;
    QLabel  *mLblVolumeRatioName;   //量比
    QLabel  *mLblVolumeRatioVal;
    QLabel  *mLblMinTradingUnitName;//每手
    QLabel  *mLblMinTradingUnitVal;
    QLabel  *mLblHistoryLowName;    //历史最低
    QLabel  *mLblHistoryLowVal;
    QLabel  *mLblDividendTTMName;       //股息TTM
    QLabel  *mLblDividendTTMVal;
    QLabel  *mLblDivYieldTTMName;       //股息率TTM
    QLabel  *mLblDivYieldTTMVal;

    QLabel  *mLblHistoryHighName;   //历史最高
    QLabel  *mLblHistroyHighVal;
    QLabel  *mLblDividendLFYName;       //股息LFY
    QLabel  *mLblDividendLFYVal;
    QLabel  *mLblDivYieldLFYName;       //股息率LFY
    QLabel  *mLblDivYieldLFYVal;

    //
    QVBoxLayout  *m_pLayout;

    QVector <StkLevelItem *> mVecBid;
    QVector <StkLevelItem *> mVecAck;
    QVector<std::shared_ptr<bid_ask_item_t>> m_vecBidData;
    QVector<std::shared_ptr<bid_ask_item_t>> m_vecAskData;
    double mPreClosePrice;

};
#endif // WIDGET_H
